package com.wufeng.spring_03_aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class MyAcpect {

    @Pointcut("execution(* com.wufeng.spring_03_aop.FunctionService.*(..))")
    public void myPointcut() {}

    @Before("myPointcut()")
    public void before(JoinPoint joinPoint) {
        System.out.println("前置信息：" + joinPoint.getSignature().getName());
    }

    @After("myPointcut()")
    public void after(JoinPoint joinPoint) {
        System.out.println("后置信息：" + joinPoint.getSignature().getName());
    }
}
